<div class="container">
			<div class="row">
			    <div class="success-page">
			        <div class="successful">
						<div class="successful-title">
							<img src="img/success.png">
							<span>订单提交成功</span>
						</div>
						<div class="successful-message">
							<div class="successful-message-user">
								<p id="orderId">订单号: <span>生成中...</span></p>
								<p id="addr-name">收货人: <span>生成中...</span></p>
								<p id="phone">手机号: <span>生成中...</span></p>
							</div>
						</div>
						<div class="successful-button">
							<button class="btn btn-default cancelorder">取消订单</button>
							<button class="btn btn-default submitorder">前往付款</button>
						</div>
					</div>
			    </div>   
			</div>			            
		</div>
<script type="text/javascript">
	$(function (){
		doGetOrderId();
		let success = $("#mainContentId").data("success");
		$("#addr-name span").text(success.addName);
		$("#phone span").text(success.phone);

		$(".cancelorder").click(function (){
			let url = `/ruoyi/user-order`;
			jumphtml(url);
		});
		$(".submitorder").click(function (){
			let success = $("#mainContentId").data("success");
			let url = `/ruoyi/order/payorder`;
			let params = {"orderId":success.orderId};
			$.ajax({
				url:url,
				data:params,
				type:"post",
				success(result){
					if (result.status===200){
						url = `/ruoyi/paysuccess`;
						jumphtml(url);
					}
				},
				error(){
					alert("支付失败!");
				}
			});
		});
	});
	function doGetOrderId(){
		let url = `/ruoyi/order/getorderid`;
		$.ajax({
			url:url,
			dataType:"json",
			success(result){
				if (result.status===200){
					$("#orderId span").text(result.data);
				}
			}
		});
	}
</script>